package test.spider;

import java.util.ArrayList;

public class App {
	
	static String BaseUrl = "http://licai.51credit.com/";
	static String DetailPageRegex = "/article/detail/.+";
	
	public static void main(String[] args) {
		Spider.regex = DetailPageRegex;
		Spider.listen();
		Spider.crawling(new ArrayList<String>(), BaseUrl);
		Runtime.getRuntime().addShutdownHook(new Thread() {
			@Override
			public void run() {
				System.out.println("总共请求了" + Spider.totalLinks + "个链接");
				System.out.println("失败了" + Spider.errorLinks + "次");
			}
		});
	}
	
}